﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using TableTop.Presentation.Controls;
using TableTop.DataManagement.Addon;

namespace TableTop.Presentation.Pages
{
    /// <summary>
    /// Interaction logic for HomePage.xaml
    /// </summary>    
    public partial class HomePage : Page
    {
    
        public HomePage()
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(HomePage_Loaded);
        }

        private void HomePage_Loaded(object sender, RoutedEventArgs e)
        {
            this.wrpAddons.Children.Clear();

            foreach (AddonInfo ai in DataHelper.Addons.Addons)
            {
                AddonDockElement adeControl = null;

                adeControl = new AddonDockElement();
                adeControl.BorderBrush = new SolidColorBrush(Colors.Black);
                adeControl.BorderThickness = new Thickness(1);
                adeControl.AddonInformation = ai;
                this.wrpAddons.Children.Add(adeControl);
            }
        }

        private void btnCharactersSheetsDocuments_Click(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(VisualHelper.Pages.SheetsBookcase);
        }

        private void btnAddNewSheet_Click(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(VisualHelper.Pages.SheetsEditor);
        }
    }
}
